home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / UTIL / SYS / LOADER / !Loader / !Help < prev    next >
Text File  |  1992-06-13  |  8KB  |  172 lines

  1. > <Loader$Dir>.!Help
  2.  
  3.                      !Loader - a file loading utility
  4.                      ================================
  5.  
  6. NB By default, the icon on the icon bar has a clock underneath it. If you
  7. don't like this, open the directory by double-clicking on !Loader with
  8. <shift> held down, edit the !Run file and put the string "noclock" after the
  9. "Run <Loader$Dir>.!RunImage" command. For the more adventurous, you can
  10. change the format of the clock by editing the string "format$" near the top
  11. of !RunImage; you should also set "format_length%" to the maximum number of
  12. displayed characters.
  13.  
  14.   This is a really simple program, but it fulfils a long felt want (at least
  15. for me). RISC OS allows you to set a run action for each file type, so that
  16. you can specify what happens when you double click on a file (which causes
  17. the Filer to *Run the file). You can also specify a load action for the
  18. *Load command, but from the desktop there's no way to trigger a load.
  19. However, when you double click, before issuing a *Run the filer sends a
  20. DataOpen message to all of the running applications to give them a chance to
  21. load the file, rather than starting a new copy of the application. !Loader
  22. just picks up this message, and looks to see if the shift key is held down.
  23. If it is it triggers a *Load; otherwise it passes the message on. As an
  24. added bonus, you can also set an AltType variable (analagous to RunType and
  25. LoadType) with a string which is used if you hold down the alt key instead.
  26.  
  27.   Before issuing the load command the system variable Loader$FileDir is set
  28. to the path name of the directory containing the clicked file. This can then
  29. be used in the LoadType alias, e.g. with "Dir |<Loader$FileDir>" (the
  30. vertical bar is important!). The file name is, of course, directly available
  31. to the alias as argument 0, but is also put into the variable Loader$File.
  32.  
  33.   The full Load (or @AltType...) command is also put into Alias$Loader_Load,
  34. so you can just type Loader_Load at the command line to re-load the same
  35. file (note that you can do this even after quitting !Loader). This is done
  36. automatically if you click with <adjust> on the *L icon.
  37.  
  38.   Clicking with <select> on the icon does the equivalent of *Load'ing an
  39. empty BASIC file. For the technically minded, it does "@LoadType_FFB null:".
  40. This actually generates a "file not found" error, but you don't see it as
  41. entering the editor clears the screen, and it does guarantee that the file
  42. name won't match anything. I feel a file load from null: should really just
  43. return EOF rather than an error; that's how it works on a VAX!
  44.  
  45.   A "load" of a directory sets it as the current directory (I was a bit
  46. surprised to discover that the Filer broadcasts a DataOpen for directories,
  47. and doesn't open them if it's claimed). A "load" with <alt> sets the parent
  48. of the clicked directory as current.
  49.  
  50.   The !Boot file of the application has some sample definitions; it does a
  51. *ScreenLoad for sprite files, loads data, obey and exec files into !Edit
  52. (but see below), and loads BASIC files into the BASIC editor (so no need for
  53. all these front ends for the editor!). The load type for text files is set
  54. to *DisplayText for use with the Archimedes World text display module. It
  55. also has AltTypes set to *Type Obey, Exec and Text files, and do
  56. *IconSprites on a sprite file.
  57.  
  58.   Note that if the load/alt type is not set for the file type an error
  59. message is generated, and the file is not run.
  60.  
  61.   There are a couple of defects to this system. Firstly, if another
  62. application is already loaded it may see the DataOpen message and act on it
  63. before !Loader gets a look in. To get around this you can drag the file
  64. directly onto the *L icon, and it will then be loaded (unless you hold the
  65. alt key down, when it will be alt'ed). The second problem occurs if you
  66. have, say, the load type of an obey file set to load the file into !Edit. If
  67. !Edit is already loaded this will try to load a second copy of it, as
  68. there's no general way of convincing a running application to load a file of
  69. a type it doesn't recognise. This isn't really a problem, though, as if the
  70. application is already running you can just drag the file to its icon on the
  71. icon bar.
  72.  
  73.   There is a PD module called ToEdit, which allows you to load a file into a
  74. running copy of !Edit with a shift-double-click, so it provides a
  75. complementary facility. To avoid clashes with this, !Loader accepts <ctrl>
  76. as an alternative to <shift>. <ctrl> always works, but <shift> is disabled
  77. if a module called "ToEdit" is in the module chain. ToEdit doesn't always
  78. seem to work, but I haven't figured out if this is a bug in !Loader or in
  79. ToEdit (or elsewhere - the !Menon hot keys also don't always work).
  80.  
  81.   There are two puzzles to go with this application:
  82.  
  83. 1) If I have !Edit loaded, either before or after !Loader, it ALWAYS claims
  84.    the DataOpen for text files, and !Loader never sees it - why not?
  85.  
  86. 2) The proginfo box doesn't seem to be moveable, despite the fact that the
  87.    relevant bit is set (and it is moveable in !FormEd). This problem appears
  88.    to go away if I add another item to the menu!
  89.  
  90. I don't know the answers to these, so it's no use asking me!
  91.  
  92.  
  93.   Finally, the boring bit. This program is FreeWare, but I retain copyright.
  94. You can copy it freely, as long as you don't sell it for profit, and as long
  95. as this file goes with it. If you make any changes (except adding load/alt
  96. types to the !Boot/!Run files), add a comment to that effect in both the
  97. "Program information" box and in this file. You can freely use bits of the
  98. code in your own applications, as long as they are credited to me in any
  99. code that you distribute. I make no warranty for the performance of the
  100. program, fitness for any purpose, or absence of bugs, and I take no
  101. responsibility for files erased, computers blown up, nuclear wars started,
  102. or any other consequence of the use of the program. Basically, I've done the
  103. best I can to make it bug free, but beyond that (as with all PD programs)
  104. you should use it with care.
  105.  
  106.   If you find the program useful you might like to make a donation to Oxfam
  107. - say £5.
  108.  
  109.   I can be contacted by e-mail on Janet (the UK academic network) as
  110. SB2 @ UK.AC.RL.IB, or by snail mail:
  111.  
  112.        Stephen Burke,
  113.    c/o 7, Egdon Drive,
  114.        Luton,
  115.        Beds
  116.        LU2 7AZ
  117.  
  118. -----------------------------------------------------------------------------
  119.  
  120. Changes:
  121.  
  122. Version 1.01, 4/8/91.
  123.  
  124. Various bells and whistles added:
  125.           
  126.    Loader$FileDir variable set to the directory path.
  127.  
  128.    Loader$File set to the file name.
  129.  
  130.    Alias$Loader_Load set to the load command string.
  131.  
  132.    Loader_Load command issued by clicking with <adjust> on the icon.
  133.  
  134.    Clicking with <select> loads a null BASIC file.
  135.  
  136.    LoadType for BASIC files changed to poke the keyboard buffer rather
  137.    than *Exec'ing a file - may be better for those without a hard disc!
  138.    Also sets the current directory to <Loader$FileDir>. Now you REALLY
  139.    don't need a front end for the BASIC editor!
  140.  
  141.    Load type for text files now set to "DisplayText" for use with
  142.    ArcWorld module; alt type is now *Type. (I think it's worth buying a
  143.    copy of Archimedes World just for this module - only 6.5K used instead
  144.    of 160K! ARCFS would be good too, if it didn't crash my SCSI filer ...)
  145.  
  146.    Run file calls !Boot, so only one copy of type definitions needed.
  147.  
  148.  
  149. Version 1.02, 17/8/91.
  150.  
  151.    Set current directory if a directory is "loaded".
  152.  
  153.    Bugs fixed - doesn't crash anymore (I hope), and deals correctly with
  154.    ToEdit.
  155.    
  156.  
  157. Version 1.03, 1/5/92.
  158.  
  159.    Added a clock under the icon.
  160.    
  161.  
  162. Version 1.04, 12/6/92.
  163.  
  164.    Made the clock existance and format (semi-) configurable.
  165.  
  166.    Interactive help support added.
  167.  
  168.  
  169. Watch out for the all new, module task version, coming soon (?) to a PD
  170. library near you!
  171.  
  172.